<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script>
var arr1=new Array(12,3,4,5);
var arr2=new Array(12,3,4,5,32,54);
Array.prototype.sum=function(){
	var result=0;
	for(var i=0;i<this.length;i++){
		result+=this[i];	
	};	
	return result;
};
//alert(arr1.sum())
//alert(arr2.sum())
alert(arr1.sum==arr2.sum)


//prototype(原型)---

//类
//对象(实例)
/*
var arr=new Array();
Array 类    不具备实际的功能，只能用来构造对象
arr 对象		真正有功能的东西，被类构造出来的
*/


</script>
</body>
</html>
